



//
//  NLeaveWordBtnView.m
//  nncloud
//
//  Created by macfai on 2018/9/25.
//  Copyright © 2018年 youedata. All rights reserved.
//

#import "NLeaveWordBtnView.h"
#import <Masonry.h>


@implementation NLeaveWordBtnView



- (instancetype)initWithFrame:(CGRect)frame{
    self=[super initWithFrame:frame];
    if (self) {
    
//        self.leaveWordBtn.layer.cornerRadius = 5.f;
//        self.leaveWordBtn.layer.masksToBounds = YES;
        [self setUI];
        self.backgroundColor = NColorFrom16RGB(0x23b7e5);
    }
    return self;
}


- (void)setUI{
    
    self.leaveWordBtn = [UIButton buttonWithType:UIButtonTypeCustom];

    [self.leaveWordBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.leaveWordBtn.titleLabel.font = kFont14;
    [self.leaveWordBtn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.leaveWordBtn];
    
    [self.leaveWordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.top.equalTo(self);
    }];
}
- (void)setBtnText:(NSString *)text
{
    [self.leaveWordBtn setTitle:text forState:UIControlStateNormal];
}
- (void)clickBtn:(id)sender
{
    if (self.didSelectBtn) {
        self.didSelectBtn();
    }
}
//- (void)awakeFromNib{
//    [super awakeFromNib];
//    self.leaveWordBtn.layer.cornerRadius = 5.f;
//    self.leaveWordBtn.layer.masksToBounds = YES;
//    
//    
//}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
